/** * Category error boundary -- catches errors loading category views. * Common triggers: category not found, access denied, network failure. * Next.js requires a default export for error boundaries. */ 'use client' import { useEffect } from 'react' import Link from 'next/link' import { usePathname } from 'next/navigation' import { WarningCircle, ArrowClockwise, House } from '@phosphor-icons/react' import { reportError } from '@/lib/error-reporting' export default function CategoryError({ error, reset, }: { error: Error & { digest?: string } reset: () => void }) { const pathname = usePathname() useEffect(() => { document.title = 'Error | Barazo' reportError(error, { boundary: 'category', path: pathname }) }, [error, pathname]) const message = process.env.NODE_ENV === 'development' ? error.message : 'This category could not be loaded. It may not exist or you may not have access.' return ( <> Error | Barazo
) }